package org.nicocube.airain.common.client;


import com.google.gwt.user.client.ui.DecoratedPopupPanel;
import com.google.gwt.user.client.ui.HTML;
import com.google.gwt.user.client.ui.HorizontalPanel;
import com.google.gwt.user.client.ui.PopupPanel;

public class AirainMessenger {
	PopupPanel popup;
	private HTML textZone;
	private HorizontalPanel hp;
	public AirainMessenger() {
		popup = new DecoratedPopupPanel(true,true);
		popup.setAnimationEnabled(true);
		popup.hide();
		hp = new HorizontalPanel();
		popup.setWidget(hp);
		textZone = new HTML("",false);
		hp.add(textZone);
	}
	
	public void hide() {
		popup.hide();
		hp.remove(1);
	}
	
	public void show(String t) {
		show(t, false);
	}

	public void show(String t, boolean b) {
		textZone.setHTML(t);
		if (b) {
			hp.add(new ProgressCircle());
		}
		popup.center();
	}
}
